﻿using Business.Base.DB.Query;
using Business.Base.Model;

using Business.Base.Service;
using PLC.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Business.CentrifugalPump.Stub
{
    public class ExperimentServiceStub : ExperimentService
    {
        public ExperimentServiceStub() : base(null, null, null) { }

        public override void StartRead() { /* 不做任何事 */ }
        public override void EndRead() { /* 不做任何事 */ }
        public override EnvData FetchDataFromEnv(DynamicParams dynamicParams)
        {
            // 返回模拟数据
            return new EnvData(1.0, 2.0, 10.0, 25.0, 1450, 380, 5.5, 1.1, 0.85);
        }
        public override void FetchData() { /* 不做任何事 */ }
        public override ExperimentRecord CaculateDataFromRecord(Experiment experiment, EnvData data)
        {
            // 返回一个简单的模拟记录
            return new ExperimentRecord
            {
                RecordTime = DateTime.Now,
                ExperimentCode = experiment.ExperimentCode,
                WorkingFlow = data.Flow,
                PresureIn = data.PresureIn,
                PresureOut = data.PresureOut,
                Voltage = data.Voltage,
                WorkingPower = data.ShaftPower,
                Temperature = data.Temperature
            };
        }
        public override BaseChartData CaculateChartData(Experiment experiment)
        {
            // 返回空或简单的ChartData
            return null;
        }
        public override void CaculateExperimentResult(ref Experiment experiment) { }
        public override List<object> QueryExperiment(BaseQuery query) => new List<object>();
        public override List<object> QueryExperimentRecord(BaseQuery query) => new List<object>();
        public override int GetExperimentCount(BaseQuery query) => 0;
        public override int GetExperimentRecordCount(BaseQuery query) => 0;
        public override void DeleteExperiment(Experiment experiment) { }
        public override void SaveExperiment(Experiment experiment) { }
        public override void FinishExperiment(Experiment experiment) { }
        public override void RemoveExperimentRecordByIds(int[] id) { }
        public override int SaveExperimentRecord(ExperimentRecord record) => 0;
    }
}
